﻿<UserControl x:Class="PairingMatrix.View.ToolBarControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Views="clr-namespace:PairingMatrix.View" xmlns:Converter="clr-namespace:PairingMatrix.View.Converter" xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behavior="clr-namespace:PairingMatrix.View.Behavior" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Height="60" Width="434" >
    <UserControl.Resources>
        <Converter:BoolToVisibilityConverter x:Key="boolToVisibilityConverter"/>
        <Converter:BoolToOpacityConverter x:Key="boolToOpacityConverter"/>
    </UserControl.Resources>

    <Grid >
        <Grid Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Name="addCard" MouseEnter="addCard_MouseEnter" MouseLeave="addCard_MouseLeave">
            <Views:ImageButton Width="60" Height="60"  x:Name="newCardButton" Command="{Binding Path=AddProjectCardCommand}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBox Height="20" VerticalAlignment="Top" HorizontalAlignment="Stretch"  Margin="10,10,5,0" Name="addCardNumber" Visibility="Collapsed" KeyDown="addCardNumber_KeyDown"/>
        </Grid>
        <Grid  Margin="62,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Views:ImageButton Width="60" Height="60" x:Name="newTeamMemberButton" Command="{Binding Path=NewTeamMemberCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
        <Grid Margin="124,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Views:ImageButton Width="60" Height="60" x:Name="pairingMatrixButton" Command="{Binding Path=ShowPairingMatrixCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
        <Grid Margin="186,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Views:ImageButton Width="60" Height="60" x:Name="iceCreamButton" Command="{Binding Path=ShowIceCreamMeterCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
        <Grid Margin="248,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Views:ImageButton Width="60" Height="60" x:Name="settingsButton" Command="{Binding Path=ShowSettingsCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
        <Grid Margin="310,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" >
            <Views:ImageButton Width="60" Height="60" x:Name="syncButton" Command="{Binding Path=SyncWithMingleCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="{Binding Path=AllowMingleSync, Converter={StaticResource boolToOpacityConverter}}"/>
            <Image Source="/PairingMatrix;component/View/Image/SyncWithMingle.png" Visibility="{Binding Path=IsSyncingAllProjectCards, Converter={StaticResource boolToVisibilityConverter}}">
                <Image.RenderTransform>
                    <RotateTransform x:Name="rotateTransform" CenterX="30" CenterY="30" Angle="0" />
                </Image.RenderTransform>
            </Image>
        </Grid>
        <Grid Margin="372,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Views:ImageButton Width="60" Height="60" x:Name="saveButton" Command="{Binding Path=SaveCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
    </Grid>
    <Interactivity:Interaction.Behaviors>
        <Behavior:RotateMingleSyncToolBarBehavior/>
    </Interactivity:Interaction.Behaviors>

</UserControl>
